package top.hmtools.makedata.random;

import java.io.UnsupportedEncodingException;
import java.util.Random;

public class RandomCharCN implements IRandom<String> {

	@Override
	public String getRandom() {
		int hightPos;
		int lowPos;
		Random random = new Random();
		hightPos = (176 + Math.abs(random.nextInt(39)));
		lowPos = (161 + Math.abs(random.nextInt(93)));
		byte[] b = new byte[2];
		b[0] = (Integer.valueOf(hightPos)).byteValue();
		b[1] = (Integer.valueOf(lowPos)).byteValue();
		try {
			return new String(b, "GBK");
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException("生成随机汉字异常", e);
		}
	}

}
